package com.fare.taluo.vo.fetl;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.fare.taluo.util.DateUtils;

/**
 * 组装的运价监控图表视图对象
 * @author xiangsf 2013-09-30
 *
 */
public class FreightMonitorChartVO implements Comparable<FreightMonitorChartVO>{
	/**
	 * 抓取的日期，格式是yyyy-MM-dd 以便同一天的比较
	 */
	private String grabDate;
	/**
	 * 抓取的次数，代表抓取日期下的第几次
	 */
	private int grabNum;
	/**
	 * 抓取的航班监控对象，监控中需要对比的航班舱位数量集合
	 */
	private List<FreightMonitorVO> monitorVOs = new ArrayList<FreightMonitorVO>();

	
	
	public FreightMonitorChartVO(String grabDate, int grabNum) {
		super();
		this.grabDate = grabDate;
		this.grabNum = grabNum;
	}

	public String getGrabDate() {
		return grabDate;
	}

	public void setGrabDate(String grabDate) {
		this.grabDate = grabDate;
	}

	public int getGrabNum() {
		return grabNum;
	}

	public void setGrabNum(int grabNum) {
		this.grabNum = grabNum;
	}

	public List<FreightMonitorVO> getMonitorVOs() {
		return monitorVOs;
	}

	public void setMonitorVOs(List<FreightMonitorVO> monitorVOs) {
		this.monitorVOs = monitorVOs;
	}

	public String getGrabNumXDesc(){
		return this.grabDate.substring(8) + "日第" + this.grabNum + "次";
	}
	@Override
	public int compareTo(FreightMonitorChartVO o) {
		return this.getGrabDate().compareTo(o.getGrabDate()) == 0
				? this.getGrabNum() - o.getGrabNum() : 
					this.getGrabDate().compareTo(o.getGrabDate());
	}
	
	
}
